package eddy.yang.server;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

public class ServerMain extends ChinaChessServerFrame {

	private static final long serialVersionUID = 306516834757341710L;

	public static void main(String[] args) {
		ChinaChessServerFrame sf = new ChinaChessServerFrame();
		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
		sf.setLocation(d.width / 2 - sf.getWidth() / 2, d.height / 2 - sf.getHeight() / 2);
		sf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		sf.setVisible(true);

		try {
			UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
			SwingUtilities.updateComponentTreeUI(sf);
		} catch (Exception ex) {
			ex.printStackTrace();
		}

		ServerListenRunnable lr = new ServerListenRunnable(sf);
		Thread listenerThread = new Thread(lr);
		listenerThread.start();
	}
}
